<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="stakeholder" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{stakeholderHome.managed ? 'Edit' : 'Add'} Stakeholder</f:facet>





            <s:decorate id="ccbField" template="layout/edit.xhtml">
                <ui:define name="label">Ccb</ui:define>
                <h:selectBooleanCheckbox id="ccb"
                                      value="#{stakeholderHome.instance.ccb}"/>
            </s:decorate>


            <s:decorate id="papelField" template="layout/edit.xhtml">
                <ui:define name="label">Papel</ui:define>
                <h:inputTextarea id="papel"
                               cols="80"
                               rows="3"
                              value="#{stakeholderHome.instance.papel}"/>
            </s:decorate>



            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{stakeholderHome.persist}"
                       disabled="#{!stakeholderHome.wired}"
                       rendered="#{!stakeholderHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{stakeholderHome.update}"
                       rendered="#{stakeholderHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{stakeholderHome.remove}"
                      immediate="true"
                       rendered="#{stakeholderHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/Stakeholder.xhtml"
                rendered="#{stakeholderHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty stakeholderFrom ? 'StakeholderList' : stakeholderFrom}.xhtml"
                rendered="#{!stakeholderHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">

    <rich:tab label="Projeto *" labelClass="required">
    <div class="association" id="projetoParent">

        <h:outputText value="There is no projeto associated with this stakeholder."
                   rendered="#{stakeholderHome.instance.projeto == null}"/>

        <rich:dataTable var="_projeto"
                   value="#{stakeholderHome.instance.projeto}"
                rendered="#{stakeholderHome.instance.projeto != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="projetoTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_projeto.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Statusprojeto id</f:facet>
                <h:outputText value="#{_projeto.statusprojeto.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Usuario id</f:facet>
                <h:outputText value="#{_projeto.usuario.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Cliente</f:facet>
                <h:outputText value="#{_projeto.cliente}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Custoprevisto</f:facet>
                <h:outputText value="#{_projeto.custoprevisto}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Datacriacao</f:facet>
                <h:outputText value="#{_projeto.datacriacao}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Fim</f:facet>
                <h:outputText value="#{_projeto.fim}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Fimprevisto</f:facet>
                <h:outputText value="#{_projeto.fimprevisto}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Inicio</f:facet>
                <h:outputText value="#{_projeto.inicio}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Justificativa</f:facet>
                <h:outputText value="#{_projeto.justificativa}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Necessidades</f:facet>
                <h:outputText value="#{_projeto.necessidades}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Nome</f:facet>
                <h:outputText value="#{_projeto.nome}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Orcamento</f:facet>
                <h:outputText value="#{_projeto.orcamento}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Premissas</f:facet>
                <h:outputText value="#{_projeto.premissas}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Produto</f:facet>
                <h:outputText value="#{_projeto.produto}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Responsabilidadesgp</f:facet>
                <h:outputText value="#{_projeto.responsabilidadesgp}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Restricoes</f:facet>
                <h:outputText value="#{_projeto.restricoes}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Resumo</f:facet>
                <h:outputText value="#{_projeto.resumo}"/>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{stakeholderHome.instance.projeto != null ? 'changeParent' : 'selectParent'}" value="#{stakeholderHome.instance.projeto != null ? 'Change' : 'Select'} projeto"
                       view="/ProjetoList.xhtml">
                <f:param name="from" value="StakeholderEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>

    <rich:tab label="Usuario *" labelClass="required">
    <div class="association" id="usuarioParent">

        <h:outputText value="There is no usuario associated with this stakeholder."
                   rendered="#{stakeholderHome.instance.usuario == null}"/>

        <rich:dataTable var="_usuario"
                   value="#{stakeholderHome.instance.usuario}"
                rendered="#{stakeholderHome.instance.usuario != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="usuarioTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_usuario.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Ddd</f:facet>
                <h:outputText value="#{_usuario.ddd}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Email</f:facet>
                <h:outputText value="#{_usuario.email}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Endereco</f:facet>
                <h:outputText value="#{_usuario.endereco}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Gp</f:facet>
                <h:outputText value="#{_usuario.gp}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Login</f:facet>
                <h:outputText value="#{_usuario.login}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Nome</f:facet>
                <h:outputText value="#{_usuario.nome}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Senha</f:facet>
                <h:outputText value="#{_usuario.senha}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Telefone</f:facet>
                <h:outputText value="#{_usuario.telefone}"/>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{stakeholderHome.instance.usuario != null ? 'changeParent' : 'selectParent'}" value="#{stakeholderHome.instance.usuario != null ? 'Change' : 'Select'} usuario"
                       view="/UsuarioList.xhtml">
                <f:param name="from" value="StakeholderEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>

    <rich:tab label="Matrizprioristakeholders for stakeholderavaliadorid">
        <h:form styleClass="association" id="matrizprioristakeholdersForStakeholderavaliadoridChildren">

            <h:outputText value="There are no matrizprioristakeholdersForStakeholderavaliadorid associated with this stakeholder."
                       rendered="#{empty stakeholderHome.matrizprioristakeholdersForStakeholderavaliadorid}"/>

            <rich:dataTable value="#{stakeholderHome.notaavaliadores}"
                           var="_matrizprioristakeholder"
                      rendered="#{not empty stakeholderHome.matrizprioristakeholdersForStakeholderavaliadorid}"
                    rowClasses="rvgRowOne,rvgRowTwo"
                            id="matrizprioristakeholdersForStakeholderavaliadoridTable">
                <rich:column sortBy="#{_matrizprioristakeholder.id}">
                    <f:facet name="header">Id</f:facet>
                    <h:outputText value="#{_matrizprioristakeholder.id}"/>
                </rich:column>
            </rich:dataTable>

        </h:form>

        <f:subview rendered="#{stakeholderHome.managed}" id="matrizprioristakeholdersForStakeholderavaliadorid">
        <div class="actionButtons">
            <s:button id="addmatrizprioristakeholder"
                   value="Add matrizprioristakeholder"
                    view="/MatrizprioristakeholderEdit.xhtml"
             propagation="none">
                 <f:param name="stakeholderId"
                         value="#{stakeholderHome.instance.id}"/>
                 <f:param name="matrizprioristakeholderFrom" value="Stakeholder"/>
            </s:button>
        </div>
        </f:subview>
    </rich:tab>

    <rich:tab label="Matrizprioristakeholders for stakeholderavaliadoid">
        <h:form styleClass="association" id="matrizprioristakeholdersForStakeholderavaliadoidChildren">

            <h:outputText value="There are no matrizprioristakeholdersForStakeholderavaliadoid associated with this stakeholder."
                       rendered="#{empty stakeholderHome.matrizprioristakeholdersForStakeholderavaliadoid}"/>

            <rich:dataTable value="#{stakeholderHome.notaavaliados}"
                           var="_matrizprioristakeholder"
                      rendered="#{not empty stakeholderHome.matrizprioristakeholdersForStakeholderavaliadoid}"
                    rowClasses="rvgRowOne,rvgRowTwo"
                            id="matrizprioristakeholdersForStakeholderavaliadoidTable">
                <rich:column sortBy="#{_matrizprioristakeholder.id}">
                    <f:facet name="header">Id</f:facet>
                    <h:outputText value="#{_matrizprioristakeholder.id}"/>
                </rich:column>
            </rich:dataTable>

        </h:form>

        <f:subview rendered="#{stakeholderHome.managed}" id="matrizprioristakeholdersForStakeholderavaliadoid">
        <div class="actionButtons">
            <s:button id="addmatrizprioristakeholder"
                   value="Add matrizprioristakeholder"
                    view="/MatrizprioristakeholderEdit.xhtml"
             propagation="none">
                 <f:param name="stakeholderId"
                         value="#{stakeholderHome.instance.id}"/>
                 <f:param name="matrizprioristakeholderFrom" value="Stakeholder"/>
            </s:button>
        </div>
        </f:subview>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
